package util;

public class Result {
    private int status;
    private String message;
    private Object data;
    public Result(){

    }
    public int getStatus(){
        return this.status;
    }
    public String getMessage(){
        return this.message;
    }
    public  Object getData(){
        return this.data;
    }
    public Result(int status, String messgae,String data){
        this.status=status;
        this.message=messgae;
        this.data=data;
    }
    public String toString(){
        return status+" "+message;
    }
    public static Result success(String data){
        return new Result(200,"success",data);
    }
    public static Result success(){
        return new Result(200,"success",null);
    }
    public static Result error(String error){
        return new Result(0,error,null);
    }
    public static Result message(int status,String error,String data){
        return new Result(status,error,data);
    }
}
